3.314 \(\int \cot (e+f x) (a+b \sec ^2(e+f x)) \, dx\)

Optimal. Leaf size=28 \[ \frac {(a+b) \log (\sin (e+f x))}{f}-\frac {b \log (\cos (e+f x))}{f} \]

[Out]

-b*ln(cos(f*x+e))/f+(a+b)*ln(sin(f*x+e))/f

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {4138, 446, 72} \[ \frac {(a+b) \log (\sin (e+f x))}{f}-\frac {b \log (\cos (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]*(a + b*Sec[e + f*x]^2),x]

[Out]

-((b*Log[Cos[e + f*x]])/f) + ((a + b)*Log[Sin[e + f*x]])/f

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rubi steps

\begin {align*} \int \cot (e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx &=-\frac {\operatorname {Subst}\left (\int \frac {b+a x^2}{x \left (1-x^2\right )} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {\operatorname {Subst}\left (\int \frac {b+a x}{(1-x) x} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac {\operatorname {Subst}\left (\int \left (\frac {-a-b}{-1+x}+\frac {b}{x}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac {b \log (\cos (e+f x))}{f}+\frac {(a+b) \log (\sin (e+f x))}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 44, normalized size = 1.57 \[ \frac {a (\log (\tan (e+f x))+\log (\cos (e+f x)))}{f}-\frac {b (\log (\cos (e+f x))-\log (\sin (e+f x)))}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]*(a + b*Sec[e + f*x]^2),x]

[Out]

-((b*(Log[Cos[e + f*x]] - Log[Sin[e + f*x]]))/f) + (a*(Log[Cos[e + f*x]] + Log[Tan[e + f*x]]))/f

________________________________________________________________________________________

fricas [A]  time = 0.51, size = 35, normalized size = 1.25 \[ -\frac {b \log \left (\cos \left (f x + e\right )^{2}\right ) - {\left (a + b\right )} \log \left (-\frac {1}{4} \, \cos \left (f x + e\right )^{2} + \frac {1}{4}\right )}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)*(a+b*sec(f*x+e)^2),x, algorithm="fricas")

[Out]

-1/2*(b*log(cos(f*x + e)^2) - (a + b)*log(-1/4*cos(f*x + e)^2 + 1/4))/f

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)*(a+b*sec(f*x+e)^2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)2/f*(-b/4*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-
cos(f*x+exp(1)))*(1+cos(f*x+exp(1)))-2))-a/4*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+exp(1
)))*(1+cos(f*x+exp(1)))+2)))

________________________________________________________________________________________

maple [A]  time = 0.60, size = 26, normalized size = 0.93 \[ \frac {b \ln \left (\tan \left (f x +e \right )\right )}{f}+\frac {a \ln \left (\sin \left (f x +e \right )\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)*(a+b*sec(f*x+e)^2),x)

[Out]

1/f*b*ln(tan(f*x+e))+a*ln(sin(f*x+e))/f

________________________________________________________________________________________

maxima [A]  time = 0.34, size = 33, normalized size = 1.18 \[ -\frac {b \log \left (\sin \left (f x + e\right )^{2} - 1\right ) - {\left (a + b\right )} \log \left (\sin \left (f x + e\right )^{2}\right )}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)*(a+b*sec(f*x+e)^2),x, algorithm="maxima")

[Out]

-1/2*(b*log(sin(f*x + e)^2 - 1) - (a + b)*log(sin(f*x + e)^2))/f

________________________________________________________________________________________

mupad [B]  time = 4.87, size = 32, normalized size = 1.14 \[ \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a+b\right )}{f}-\frac {a\,\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}{2\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(e + f*x)*(a + b/cos(e + f*x)^2),x)

[Out]

(log(tan(e + f*x))*(a + b))/f - (a*log(tan(e + f*x)^2 + 1))/(2*f)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sec ^{2}{\left (e + f x \right )}\right ) \cot {\left (e + f x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)*(a+b*sec(f*x+e)**2),x)

[Out]

Integral((a + b*sec(e + f*x)**2)*cot(e + f*x), x)

________________________________________________________________________________________